﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Configurations;

namespace Pixysoft.Framework.Logs.Core
{
    class LogFrame : ILogFrame
    {
        IXmlNode node;

        public LogFrame(IXmlNode node)
        {
            this.node = node;
        }

        public string Dll
        {
            get { return node.Properties[StringHelper.default_attribute_dll]; }
            set { node.Properties[StringHelper.default_attribute_dll] = value; }
        }

        public string Class
        {
            get { return node.Properties[StringHelper.default_attribute_class]; }
            set { node.Properties[StringHelper.default_attribute_class] = value; }
        }

        public string Method
        {
            get { return node.Properties[StringHelper.default_attribute_method]; }
            set { node.Properties[StringHelper.default_attribute_method] = value; }
        }

        public string File
        {
            get { return node.Properties[StringHelper.default_attribute_file]; }
            set { node.Properties[StringHelper.default_attribute_file] = value; }
        }

        public string Path
        {
            get { return node.Properties[StringHelper.default_attribute_path]; }
            set { node.Properties[StringHelper.default_attribute_path] = value; }
        }

        public int Line
        {
            get { return node.Properties.Get<int>(StringHelper.default_attribute_line); }
            set { node.Properties[StringHelper.default_attribute_line] = value.ToString(); }
        }

        public int Column
        {
            get { return node.Properties.Get<int>(StringHelper.default_attribute_column); }
            set { node.Properties[StringHelper.default_attribute_column] = value.ToString(); }
        }

        public int ILOffset
        {
            get { return node.Properties.Get<int>(StringHelper.default_attribute_il); }
            set { node.Properties[StringHelper.default_attribute_il] = value.ToString(); }
        }
    }
}
